package com.tuanzi.loan.web.lazy.family;


import com.tuanzi.loan.business.service.family.LoanAdvertService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.LoanAdvertSearchRequest;
import com.tuanzi.loan.vo.response.family.LoanAdvertSearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;


public class LoanAdvertLazyDataModel extends LazyDataSessionModel<LoanAdvertSearchRequest, LoanAdvertSearchResponse> {

    private LoanAdvertService loanAdvertService;

    public LoanAdvertLazyDataModel(LoanAdvertSearchRequest searchRequest, CurrentUserBean session, LoanAdvertService loanAdvertService) {
        super(searchRequest, session);
        this.loanAdvertService = loanAdvertService;
    }

    @Override
    protected Page<LoanAdvertSearchResponse> doLoad0(PageSearcher<LoanAdvertSearchRequest> pageSearcher) {
        return loanAdvertService.list(pageSearcher);
    }
}
